package edu.hunan.cxb18.result;

/**
 * @author AuthorName
 * @create 2020-04-23 10:11
 */
public class CommonTypeResult {
    //status标识，为success返回json格式数据，为false返回错误码
    private String status;
    private Object data;

    //定义一个通用的创建方法
    public static CommonTypeResult creat(Object result){
        return CommonTypeResult.creat(result,"success");
    }

    public static CommonTypeResult creat(Object result, String status){
        CommonTypeResult type = new CommonTypeResult();
        type.setStatus(status);
        type.setData(result);
        return type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
